ContextCompat
Helper for accessing features in Context.
Inheritors
Types
Link copied to clipboard
Properties
Link copied to clipboard
Flag for registerReceiver: The receiver can receive broadcasts from other Apps.
Link copied to clipboard
Flag for registerReceiver: The receiver cannot receive broadcasts from other Apps.
Link copied to clipboard
Flag for registerReceiver: The receiver can receive broadcasts from Instant Apps.
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage.
Link copied to clipboard
Attribution can be used in complex apps to logically separate parts of the app.
Link copied to clipboard
Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.
Link copied to clipboard
Returns a color state list associated with a particular resource ID.
Link copied to clipboard
Gets the context which respects the per-app locales locale.
Link copied to clipboard
Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored.
Link copied to clipboard
Get the display this context is associated with or the default display as the fallback if the context is not associated with any Display.
Link copied to clipboard
Returns a drawable object associated with a particular resource ID.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the absolute path to the directory on the filesystem similar to getFilesDir.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Indicates if the storage APIs of this Context are backed by device-encrypted storage.
Link copied to clipboard
open fun registerReceiver(@NonNull context: Context, @Nullable receiver: BroadcastReceiver, @NonNull filter: IntentFilter, flags: Int): Intent
open fun registerReceiver(@NonNull context: Context, @Nullable receiver: BroadcastReceiver, @NonNull filter: IntentFilter, @Nullable broadcastPermission: String, @Nullable scheduler: Handler, flags: Int): Intent
Register a broadcast receiver.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
startForegroundService() was introduced in O, just call startService for before O.